function f=showDensityTrend(density,obsQxD_one,obsQxD_two,connected_one,connected_two)

f=figure;
nSubjs=size(obsQxD_one,2);
indx_one=find(sum(connected_one,2)==nSubjs,1,'first');

indx_two=find(sum(connected_two,2)==nSubjs,1,'first');
if(~isempty(indx_one)&&~isempty(indx_two))
    Y_one=mean(obsQxD_one,2);
    E_one=std(obsQxD_one,[],2);

    Y_two=mean(obsQxD_two,2);
    E_two=std(obsQxD_two,[],2);

    errorbar(density(indx_one:end),Y_one(indx_one:end),E_one(indx_one:end),'ob')
    hold on
    errorbar(density(indx_two:end),Y_two(indx_two:end),E_two(indx_two:end),'*r')
    xlabel('density')
    ylabel('modularty')
else
    error('at least one of conditions generates disconnected networks at density interval ')
end